package com.huanxun.utils;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * 获取首选项
 *
 */
public final class SPUtils {
	private final static String name="msglist";
	private final static int mode = Context.MODE_PRIVATE;
	
	    public static boolean getBoolean(Context context,String key,boolean defValue) { 
	    	SharedPreferences sp = context.getSharedPreferences(name, mode);
	            return sp.getBoolean(name, defValue); 
	    }  
	    
	    
	    public static void saveBoolean(Context context,String key,boolean value) {  
	        context.getSharedPreferences(name, mode).edit().putBoolean(key, value).commit();
	    }  
}
